package tests;

import static org.junit.Assert.*;
import mt.Order;
import mt.comm.ClientMsg;
import mt.comm.ClientSideMessage.Type;

import org.junit.Before;
import org.junit.Test;

public class ClientMsgTest {
	
	private ClientMsg yolo; 
	private String error;
	private Order order;
	private Type type = Type.ORDER;
	
	@Before
	public void setUp() throws Exception {
		error="Ola marinheiros, nao ha erro";
		order.createBuyOrder("toino", "world of warcraft",10,30);
		
	}
	
	@Test
	public void testClientMsg() {
		yolo = new ClientMsg(type, order, error);
	}

	@Test
	public void testGetType() {
		yolo = new ClientMsg(type, order, error);
		assertEquals(yolo.getType(),Type.ORDER);

	}

	@Test
	public void testGetOrder() {

		yolo = new ClientMsg(type, order, error);
		assertEquals(yolo.getOrder(), order);

	}

	@Test
	public void testGetError() {
		yolo = new ClientMsg(type, order, error);
		assertEquals(yolo.getError(), error);

	}

	@Test
	public void testToString() {
	
		yolo = new ClientMsg(type, order, error);
		yolo.toString();
	}

}
